<template>
  <div class="header flex-y-center">
    <div class="logo"><img style="width:1.2rem;" v-src="'/wxStatic/img/index_title_image.png'" alt=""></div>
    <div class="inputBox" @click="toSearch">
      <img class="searchicon" v-src="'/wxStatic/img/searchPic.png'" alt="">
      请输入宝贝名称或关键字
    </div>
  </div>
</template>
<script>
  export default {
    // props: {
    //   title: {
    //     type: String,
    //     default: '首页'
    //   },
    //   goBack: {
    //     type: Boolean,
    //     default: false
    //   },
    //   searchIocn: {
    //     type: Boolean,
    //     default: true
    //   },
    //   helpTip: {
    //     type: Boolean,
    //     default: false
    //   }
    // },
    data() {
      return {

      }
    },
    mounted() {
    },
    methods: {
      toBack() {
        console.log(window.history.length);
        //直接打开某个切面；返回不用能；就直接跳转首页、、、window.history.length=2

        if (window.history.length <= 3) {
          window.location.href = 'https://m.zetianhui.com';
        } else {
          window.history.go(-1);
        }

      },
      toSearch(){
        let toUrl = window.location.origin + '/wx/search.html'
        window.location.href = toUrl ;
      }
    }
  }
</script>
<style lang="less" scoped>
  .header {
    height: 45px;
    padding-left: 0.5rem;
    background: linear-gradient(left, #fe3e71, #ff3e49);
    background: -webkit-gradient(linear, left top, right top, from(#fe3e71), to(#ff3e49));
    /*.logo{*/
      /*position: absolute;*/
      /*left: 0.4rem;*/
      /*top:50%;*/
      /*transform: translateY(-50%);*/
    /*}*/
    .inputBox{
      color:#fff;
      position: relative;
      width:4.38rem;
      height:0.64rem;
      line-height: 0.64rem;
      background: url("../../wxStatic/img/bg_search.png") no-repeat top center;
      background-size: 100% 100%;
      //background: rgba(255,255,255,0.2);
      padding-left: 0.8rem;
      margin-left: 0.6rem;
      font-size:0.24rem;
      .searchicon{
        width:0.3rem;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        left:0.32rem;
      }
    }
  }
</style>
